cmake_minimum_required(VERSION 3.10)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 COMPONENTS Core Widgets Network REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Widgets  Network REQUIRED)

include_directories(${TASKBUS_INTERFACEDIR})
set(PRJ_HEADERS
	dlgwrpstdio.h
	listen_thread.h
)
set(PRJ_SOURCES
	main.cpp
	dlgwrpstdio.cpp
	listen_thread.cpp
	resource.qrc
)
set(PRJ_FORMS
	dlgwrpstdio.ui
)
#############Target======================
qt_add_executable(wrapper_stdio
	MANUAL_FINALIZATION
	${PRJ_HEADERS}
	${PRJ_SOURCES}
	${PRJ_FORMS}
)

target_link_libraries(wrapper_stdio PRIVATE
	Qt${QT_VERSION_MAJOR}::Widgets
	${TBLinkExtra}
)

set_target_properties(wrapper_stdio PROPERTIES
	MACOSX_BUNDLE_GUI_IDENTIFIER taskBus.modules.network_p2p
	MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
	MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
	MACOSX_BUNDLE TRUE
	WIN32_EXECUTABLE TRUE
)
qt_finalize_executable(wrapper_stdio)

